<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
    <meta content="" name="description">
    <meta content="" name="author">

    <title>Dashboard Template for Bootstrap</title>
    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">

    <!-- Custom styles for this template -->
    <link rel="stylesheet" th:href="@{/css/dashboard.css}">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
    </style>
</head>

<body>
<div th:insert="~{commons/commons::topbar}"></div>

<div class="container-fluid">
    <div class="row">
        <div th:insert="~{commons/commons::sidebar(active='list.html')}"></div>

        <main class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4" role="main">
            <form class="form-horizontal" method="post" th:action="@{/emp/update}">
                <input name="id" th:value="${emp.getId()}" type="hidden">
                <div class="form-group">
                    <label class="col-sm-2 control-label">姓名</label>
                    <div class="col-sm-10">
                        <input class="form-control" name="lastName" placeholder="姓名" th:value="${emp.getLastName()}"
                               type="text">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">Email</label>
                    <div class="col-sm-10">
                        <input class="form-control" name="email" placeholder="Email" th:value="${emp.getEmail()}"
                               type="email">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">性别</label>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" name="gander" th:checked="${emp.getGander()==1}" type="radio"
                               value="1">
                        <label class="form-check-label">男</label>
                    </div>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" name="gander" th:checked="${emp.getGander()==0}" type="radio"
                               value="0">
                        <label class="form-check-label">女</label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">所属部门</label>
                    <select class="form-control col-sm-10" name="department.id">
                        <option th:each="dept:${departments}" th:selected="${dept.getId()==emp.getDepartment().getId()}"
                                th:text="${dept.getDepartmentName()}" th:value="${dept.getId()}"></option>
                    </select>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">生日</label>
                    <div class="col-sm-10">
                        <input class="form-control" name="birth" placeholder="1975-01-01"
                               th:value="${#dates.format(emp.getBirth(),'yyyy-MM-dd')}" type="text">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button class="btn btn-default" type="submit">修改</button>
                    </div>
                </div>
            </form>
        </main>
    </div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="asserts/js/jquery-3.2.1.slim.min.js" type="text/javascript"></script>
<script src="asserts/js/popper.min.js" type="text/javascript"></script>
<script src="asserts/js/bootstrap.min.js" type="text/javascript"></script>

<!-- Icons -->
<script src="asserts/js/feather.min.js" type="text/javascript"></script>
<script>
    feather.replace()
</script>

<!-- Graphs -->
<script src="asserts/js/Chart.min.js" type="text/javascript"></script>
<script>
    var ctx = document.getElementById("myChart");
    var myChart = new Chart(ctx, {
        type: 'line',
        data: {
            labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
            datasets: [{
                data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
                lineTension: 0,
                backgroundColor: 'transparent',
                borderColor: '#007bff',
                borderWidth: 4,
                pointBackgroundColor: '#007bff'
            }]
        },
        options: {
            scales: {
                yAxes: [{
                    ticks: {
                        beginAtZero: false
                    }
                }]
            },
            legend: {
                display: false,
            }
        }
    });
</script>

</body>

</html>
